package com.tedu.mall.controller;

import com.tedu.mall.mapper.CategoryMapper;
import com.tedu.mall.pojo.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class CategoryController {
    @Autowired
    CategoryMapper categoryMapper;
    //查询所有商品分类
    @RequestMapping("/category/selectAll")
    public List<Category> selectAll(){
        return  categoryMapper
                .selectByExample(null);
    }
}
